{% extends "layout.html" %} 
{% block content %} 
	<div class="fz16 search">
		<header class="search-hd">
			<!-- <span class="goback zymkwap ift-goback" @click="goback"></span> -->
			<span class="goback zymkwap ift-goback"></span>
			<!-- <input class="search-area" type="text" v-model="keywords" @keyup.enter="jumpUrl(keywords)" placeholder="可按 漫画名 或 漫画家 搜索"> -->
			<input class="search-area" type="text" placeholder="可按 漫画名 或 漫画家 搜索">
			<!-- <span class="searchBtn zymkwap ift-search" @click="jumpUrl(keywords)"></span> -->
			<span class="searchBtn zymkwap ift-search"></span>
		</header>
		{#{% if not tmpSearch %}#}
			<div class="hot-search">
				<div class="hot-hd">热门搜索</div>
				<div class="hot-tags">
					{% for item in hotSearch %}
						<a class="tag" href="detail/{{item.comic_id}}" style="background: tagColors[{{loop.index0 % tagColors.length}}]"><span>{{item.comic_name}}</span></a>
					{% endfor %}
				</div>
			</div>
		{#{% endif %}#}
		{#{% if not tmpSearch %}#}
			<div class="hisSrch">
				<div class="hisSrch-hd">
					<span>搜索历史</span>
					<!-- <span class="historyClear" @click="historyClear" v-if="searched.length != 0">清空</span> -->
					{#{% if searched.length > 0 %}#}
						<span class="historyClear">清空</span>
					{#{% endif %}#}
				</div>
				<div class="hisSrch-list">
					{#{% for item in searched %}#}
						<div class="hisSrch-item">
							<div class="itemBox">
								<div class="zymkwap ift-clock"></div>
								<a class="history-text" href="sort?key={{item}}&sort=click&page=1&by=人气}}">{{item}}</a>
								<!-- <div class="zymkwap ift-close" :data-searched="searched[idx]" @click="historyDel"></div> -->
								<div class="zymkwap ift-close" data-searched="searched[{{loop.index0}}]"></div>
							</div>
						</div>
					{#{% endfor %}#}
					{#{% if searched.length == 0 %}#}
						<p class="empty">暂无搜索历史^_^</p>
					{#{% endif %}#}
				</div>
			</div>
		{#{% endif %}#}
		{#{% if tmpSearch and searchRes %}#}
			<div class="tmpSrch">
				<div class="tmpSrch-hd">搜索结果</div>
				<div class="tmpSrch-list">
					{#{% for item in searchRes.page.comic_list %}#}
						<a class="tmpSrch-item" href="detail/{{item.comic_id}}">
							<div class="itemBox">
								<span>{{item.comic_name}}</span>
								<span class="last-chapter">{{item.last_chapter.name}}</span>
							</div>
						</a>
					{#{% endfor %}#}
					{#{% if searchRes.page.total_num == 0 %}#}
						<p class="empty">暂无相关搜索结果^_^</p>
					{#{% endif %}#}
				</div>
			</div>
		{#{% endif %}#}
	</div>
{% endblock %}